<template>
  <div class="child-one-view">
    <p>子组件-childOne</p>
    <p>被父元素调用{{ next }}次</p>
    <van-button plain type="info" @click="getParent">调用父组件</van-button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      next: 0,
    };
  },
  methods: {
    getParent() {
      this.$parent.setChildText("childOne");
    },
    getChildOne() {
      this.next += 1;
      console.log("这个是childOne 组件事件");
    },
    getChildOne_1() {
      console.log("这个是childOne 组件事件");
    },
  },
};
</script>
<style lang="scss" scoped>
.child-one-view {
  margin: 20px 10px;
  padding: 10px;
  background-color: #fff;
  border-radius: 8px;
  .input-view {
    display: block;
    border: none;
    border-bottom: 1px solid #ccc;
  }
  .btn {
    display: inline-block;
    margin: 10px 0 10px;
    padding: 5px 20px;
    border-radius: 8px;
    background-color: #67c23a;
    color: #fff;
    font-size: 12px;
  }
}
</style>